﻿
Partial Class identification
    Inherits System.Web.UI.Page

    Protected Sub BtnConnect_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnConnect.Click
        Dim dbUser As New LogDataSetTableAdapters.user_detailTableAdapter
        Dim data As New LogDataSet.user_detailDataTable
        data = dbUser.GetDataById(TextBoxId.Text)
        Try
            Session("id") = data(0).user_id
            Session("pwd") = data(0).user_pwd
            Session("type") = data(0).user_type
            Session("droit") = data(0).user_droit
            Session("nom") = data(0).user_nom
            Session("prenom") = data(0).user_prenom
            If Session("pwd") = TextBoxPwd.Text Then
                Select Case Session("droit")
                    Case "ADM"
                        Response.Redirect("ADM.aspx")
                    Case "USER"
                        Response.Redirect("USER.aspx")
                    Case "DEV"
                        Response.Redirect("DEV.aspx")
                    Case Else
                        TextBoxId.Text = ""
                        TextBoxPwd.Text = ""
                End Select
            End If
        Catch ex As Exception
            TextBoxId.Text = ""
            TextBoxPwd.Text = ""
        End Try
    End Sub

End Class

